# --------------------------------------------------
# -*- coding: utf-8 -*-
# Time: 2023/3/11 17:08
# Author: 沈凌鹏
# Version: 0.1
# File: triangle_demo.py
# Description: 验证可否构成三角形的代码实现
# --------------------------------------------------

class Triangle:

    # 验证三条边能不能构成三角形状
    def triangle(self, a, b, c):
        # 三角形的每条边必须为正数
        if a > 0 and b > 0 and c > 0:
            # 两边之和大于第三边,同时两边之差小于第三边即可构成三角形
            if (a + b > c and a + c > b and c + b > a) and (abs(a - b) < c and abs(a - c) < b and abs(c - b) < a):
                return 'yes'
            else:
                return 'no'
        else:
            return 'no'
